package cz.muni.fi.pa165.rentalofconstructionmachinery.dto.converters;

import cz.muni.fi.pa165.rentalofconstructionmachinery.dto.MachineDTO;
import cz.muni.fi.pa165.rentalofconstructionmachinery.entity.Machine;

/**
 *
 * @author Adam Zmrzlý
 */
public class MachineDTOConverter {
    
    public static Machine dtoToEntity(MachineDTO dto) {
       Machine machine = new Machine();
       machine.setId(dto.getId());
       machine.setLicensePlate(dto.getLicensePlate());
       machine.setType(dto.getType());
       return machine;
    }

    public static MachineDTO entityToDTO(Machine machine) {
       return new MachineDTO(machine.getId(), machine.getLicensePlate(), machine.getType());
    }
}
